
<template>
  <div>
    <el-row>
      <el-col :span="24">
        <el-form :inline="true" :model="search" label-width="100px">
          <el-form-item :label="$t('toolingBarcode')">
            <el-input v-model="search.toolingBarcode" :placeholder="$t('searchtoolingbarcode')" clearable />
          </el-form-item>
          <el-form-item :label="$t('eqpName')">
            <el-select
              v-model="search.eqpName"
              :placeholder="$t('searcheqpname')"
              clearable

              style="width: 200px"
              class="filter-item"
              filterable
            >
              <el-option
                v-for="item in eqpNameList"
                :key="item.id"
                :value="item.name"
                :label="item.name"
              />
            </el-select>
          </el-form-item>
          <el-form-item :label="$t('toolingType')">
            <el-select
              v-model="search.toolingType"
              :placeholder="$t('searchtoolingType')"
              clearable

              style="width: 200px"
              class="filter-item"
            >
              <el-option
                v-for="item in toolingTypeList"
                :key="item.id"
                :value="item.id"
                :label="item.name"
              />
            </el-select>
          </el-form-item>
          <el-form-item :label="$t('flag')">
            <el-select
              v-model="search.flag"
              :placeholder="$t('searchflag')"
              clearable

              style="width: 200px"
              class="filter-item"
            >
              <el-option
                v-for="item in toolingFlagList"
                :key="item.id"
                :value="item.id"
                :label="item.name"
              />
            </el-select>
          </el-form-item>
          <el-form-item label="厂内编号">
            <el-input
              v-model="search.naternal_barcode"
              :placeholder="$t('naternal_barcode')"
              clearable
            />
          </el-form-item>
          <el-form-item>
            <el-button
              type="primary"
              icon="el-icon-search"

              @click="doSearch">{{ $t('search') }}</el-button>
          </el-form-item>
        </el-form>
      </el-col>
    </el-row>
  </div>
</template>
<script>
import crudJob from '@/api/Tooling/toolingBasicInfo'
import eqpbase from '@/api/equipment/eqpbase'
export default {
  data() {
    return {
      eqpNameList: [],
      toolingTypeList: [],
      toolingFlagList: [],
      search: {}
    }
  },
  created() {
    eqpbase.eqpnamelist().then(res => {
      this.eqpNameList = res.data
    })

    crudJob.GetToolingTypeList().then(res => {
      this.toolingTypeList = res.data
    })

    crudJob.GetToolingFlagList().then(res => {
      this.toolingFlagList = res.data
    })
  },
  methods: {
    doSearch() {
      this.$emit('doSearch', this.search)
    }
  }
}
</script>
<style lang="scss" scoped>
@import "~@/assets/styles/defaultStyle.scss";
</style>
<style lang="scss" scoped>
.el-form-item {
  margin-bottom: 0;
}
</style>
